import request from '/@/utils/request';


export function useQuesApi() {
	return {
		cateTree: () => {
			return request({
				url: '/api/ques/v1/cate/tree',
				method: 'get',
			});
		},
		cateSelect: (params) => {
			return request({
				url: '/api/ques/v1/cate/select',
				method: 'get',
				params
			});
		},
		cateInfo: (id) => {
			return request({
				url: `/api/ques/v1/cate/info/${id}`,
				method: 'get',
			});
		},
		cateAdd: (data) => {
			return request({
				url: `/api/ques/v1/cate/add`,
				method: 'post',
				data
			});
		},
		cateUpdate: (data) => {
			return request({
				url: `/api/ques/v1/cate/update`,
				method: 'put',
				data
			});
		},
		cateDelete: (id) => {
			return request({
				url: `/api/ques/v1/cate/delete/${id}`,
				method: 'delete',
			});
		},


		bankPage:(params) => {
			return request({
				url: `/api/ques/v1/bank/page`,
				method: 'get',
				params
			});
		},
		bankInfo:(id) => {
			return request({
				url: `/api/ques/v1/bank/info/${id}`,
				method: 'get',
			});
		},
		bankAdd:(data) => {
			return request({
				url: `/api/ques/v1/bank/add`,
				method: 'post',
				data
			});
		},
		bankUpdate:(data) => {
			return request({
				url: `/api/ques/v1/bank/update`,
				method: 'put',
				data
			});
		},
		bankDelete:(data) => {
			return request({
				url: `/api/ques/v1/bank/delete`,
				method: 'delete',
				data
			});
		},
		
		importQues: (data) => {
			return request({
				headers: { 'Content-Type': 'multipart/form-data'},
				url: `/api/ques/v1/bank/import`,
				method: 'post',
				data
			});
		},
		exportQues: (data) => {
			return request({
				headers: { 'Content-Type': 'multipart/form-data'},
				responseType: "blob",
				url: `/api/ques/v1/bank/export`,
				method: 'post',
				data
			});
		},
		downQuesImportTemplateFile:() => {
			return request({
				responseType: "blob",
				url: `/api/download/bank/template/file`,
				method: 'post',
			});
		}
	};
}
